/**
 * 
 */
package com.curso.sesion9;

/**
 * @author MATEUS
 *
 */
public class Singleton {
	private	int v ;
	private static Singleton name;
	
	private Singleton(int v){
		this.v = v;
	}
	
	
	public static Singleton getInstance(int v) {
		if (name == null) {
			name = new Singleton(v);
		} else {
			name.v = v;	
		}
		return name;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Singleton [v=" + v + "]";
	}
	
}
